package com.micro.common.service.orm;

import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.micro.framework.starter.mybatis.utils.CodeGeneratorBase;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author yinbaoxin
 * @Date 2023/6/10
 * @Desc
 */
public class CodeGenerator extends CodeGeneratorBase {
    @Override
    public String getFilePath() {
        return "D:\\yjb\\auto_orm\\common-service";
        // return System.getProperty("user.dir")+ File.separator+"nacos-center";
    }

    @Override
    public String getPackageName() {
        return "com.micro.common.service.orm";
    }


    @Override
    public DataSourceConfig getDataSourceConfig() {
        DataSourceConfig dsc = new DataSourceConfig();
        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/auth_center?characterEncoding=UTF-8&useSSL=false&rewriteBatchedStatements=true&allowMultiQueries=true");
        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
        dsc.setUsername("root");
        dsc.setPassword("root123");
        return dsc;
    }


    public String getTablePrefix() {
        return "t_";
    }

    public static void main(String[] strings) {
        CodeGenerator codeGenerator = new CodeGenerator();
        List<String> list = new ArrayList<String>();
        list.add("t_address");
        codeGenerator.runCodeGenerator(list);
    }
}
